{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
    <div class="main">
        <!-- left side start-->
        <section class="left-section">
            <dl id="leftNav" data-type="product">
                <dt><i class="glyphicon glyphicon-record"></i>商品管理</dt>
                {if in_case_array('admin/product/add',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/product/add}">商品发布</a></dd>
                {/if}
                {if in_case_array('admin/product/indexBySale',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/product/indexBySale}">出售中的商品</a></dd>
                {/if}
                {if in_case_array('admin/product/indexByStore',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/product/indexByStore}">仓库中的商品</a></dd>
                {/if}
                {if in_case_array('admin/repertory',$priv) || empty($priv)}
                <dd><a class="mb active" href="{url /admin/repertory/index}">仓库信息</a></dd>
                {/if}
            </dl>
        </section>
        <!-- left side end-->


        <!-- main content start-->
        <section class="right-section" id="right-section">
            {include admin.inc.bread}
            <h2 class="header">{$title}</h2>
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                <div class="inner-container">
                    <form role="form" class="form-horizontal basicForm content-add-form" id="content-add-form"
                          autocomplete="off">
                        <input type="hidden" name="data[id]" value="{$item[id]}">

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span
                                    class="asterisk">*</span>仓库名称</label>
                            <div class="col-sm-4">

                                <input type="text" class="form-control" required cname="仓库名称" name="data[name]"
                                       value="{$item[name]}" data-name="仓库名称">
                            </div>
                            <p class="help-block">

                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>仓库面积(㎡)</label>
                            <div class="col-sm-4">

                                <input dtype="" class="form-control" maxlength="20" name="data[area]"
                                       placeholder="仓库面积" required cname="仓库面积" value="{$item[area]}"/>

                            </div>
                            <p class="help-block"></p>

                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>性质</label>

                            <div class="col-sm-4">
                                {setRadioOptions $repertoryTypeList data[type] $item['type']}

                            </div>
                        </div>

                        <!-- input -->
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>联系人</label>
                            <div class="col-sm-4">

                                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[contact]"
                                       placeholder="联系人" required cname="联系人" value="{$item[contact]}"/>
                            </div>
                            <p class="help-block"></p>

                        </div>

                        <!-- input -->
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>联系电话 </label>
                            <div class="col-sm-4">

                                <input dtype="mobile" class="form-control" maxlength="{maxlength}"
                                       name="data[contact_mobile]"
                                       placeholder="联系电话" required cname="联系电话" value="{$item[contact_mobile]}"/>
                            </div>
                            <p class="help-block"></p>

                        </div>


                        <div class="form-group">


                            <label class="col-sm-2 control-label"><span class="asterisk">*</span>仓库地址</label>
                            <div id="city" class="col-sm-8">

                                <div class="area-wrap"></div>

                                <p class="help-block"></p>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>

                            <div class="col-sm-4">
                                <input dtype="" class="form-control" maxlength="{maxlength}" name="data[street]"
                                       placeholder="街道地址" required cname="街道地址" value="{$item[street]}"/>
                            </div>
                            <p class="help-block"></p>

                        </div>
                        <!--tmpl-assocfields-->
                        <div class="btn-group btn-group-or">
                            <a href="{$do_edit_url}"
                               class="btnlg mb ajaxproxy"
                               proxy='{"method":"post", "location":"index"}'>提交保存</a>

                        </div>
                    </form><!-- content add form -->
                </div>
            </div><!-- end of inner -->
        </section>
    </div>
</div>
{include admin.inc.footer}

<!--tmpl-script-->

<!-- pagescript -->
<script type="text/javascript">
    seajs.use("admin/repertoryadd", function (parameter) {
        //parameter.address = '{$item[address]}';
        parameter.area={
            prov : '{$item[prov]}', //省
            city : '{$item[city]}', //市s
            dist : '{$item[dist]}' //区
        };
        parameter.initByEdit();

    });
</script>

<script id="assocpage" type="text/html">
    <div class="text-right">
        <ul class="pagination blog-pagination">
            <li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li>
            {[loop pages page]}

            <li><a class="assoc-page" data-page="{[page]}" {[if curr== page]}class="active" {[/if]}
                href="javascript:void(0)">{[page]}</a></li>

            {[/loop]}
            <li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li>
        </ul>
    </div>
</script>

</body>
</html>
